package com.lz.springboot.disconf.config;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;

@Service  
@Scope("singleton")  
@DisconfFile(filename = "redis.properties")  
public class JedisConfig { 
	
    private String maxActive;  
    private String maxIdle;  
    private String maxWait;  
    private String testOnBorrow;  
    private String testOnReturn;  
    private String timeout;
    private String ip;
    private String port;
    private String dbIndex;
    
	
	public String getInfo() {
		return "JedisConfig [maxActive=" + maxActive + ", maxIdle=" + maxIdle + ", maxWait=" + maxWait
				+ ", testOnBorrow=" + testOnBorrow + ", testOnReturn=" + testOnReturn + ", timeout=" + timeout + ", ip="
				+ ip + ", port=" + port + ", dbIndex=" + dbIndex + "]";
	}

	@DisconfFileItem(name = "redis.pool.maxActive", associateField = "maxActive")  
    public String getMaxActive() {
		return maxActive;
	}

	public void setMaxActive(String maxActive) {
		this.maxActive = maxActive;
	}

	@DisconfFileItem(name = "redis.pool.maxIdle", associateField = "maxIdle")
	public String getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(String maxIdle) {
		this.maxIdle = maxIdle;
	}

	@DisconfFileItem(name = "redis.pool.maxWait", associateField = "maxWait")
	public String getMaxWait() {
		return maxWait;
	}

	public void setMaxWait(String maxWait) {
		this.maxWait = maxWait;
	}

	@DisconfFileItem(name = "redis.pool.testOnBorrow", associateField = "testOnBorrow")
	public String getTestOnBorrow() {
		return testOnBorrow;
	}

	public void setTestOnBorrow(String testOnBorrow) {
		this.testOnBorrow = testOnBorrow;
	}

	@DisconfFileItem(name = "redis.pool.testOnReturn", associateField = "testOnReturn")
	public String getTestOnReturn() {
		return testOnReturn;
	}

	public void setTestOnReturn(String testOnReturn) {
		this.testOnReturn = testOnReturn;
	}

	@DisconfFileItem(name = "redis.pool.timeout", associateField = "timeout")
	public String getTimeout() {
		return timeout;
	}

	public void setTimeout(String timeout) {
		this.timeout = timeout;
	}

	@DisconfFileItem(name = "redis.ip", associateField = "ip")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}
	
	@DisconfFileItem(name = "redis.port", associateField = "port")
	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	@DisconfFileItem(name = "redis.dbIndex", associateField = "dbIndex")
	public String getDbIndex() {
		return dbIndex;
	}

	public void setDbIndex(String dbIndex) {
		this.dbIndex = dbIndex;
	}
	
}  